|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.util.Screen
public final class Screen
A utility class for dealing with screen setting, like setting the display to "fullscreen", setting the cursor, makeing the cursor invisible, etcetera. The most usefull methods are : setFullScreen(Frame frame) setInvisibleCursor(Component c) setCursor(Component c, int cursorType) restoreCursor(Component c) It is possible to set the display mode, dealing with refresh rate and screen resolution; with LCD monitors this is usually not desirable, since refresh rates are fixed, and screen resolution has only one optimal setting.
| Field Summary | |
|---|---|
static int |
CURRENT_VALUE
constants that can be used as parameters for Screen methods like setFullScreen(), selectDisplayModes |
private static int |
CURSORSIZE
|
private static GraphicsDevice |
defaultDevice
|
private static int[] |
DEFAULTSCREENSIZELIST
value for selecting a default list of display modes |
private static int |
EXPECTEDLABELLENGTH
|
static int |
HIGHCOLOR
|
static int |
MAX
|
private static int |
MAXDIMENSION
|
static int |
MIN
|
private static Cursor |
noCursor
|
private static Cursor |
prevCursor
|
static int |
SHOWBITDEPTH
|
static int |
SHOWFULLDISPLAYMODE
|
static int |
SHOWREFRESHRATE
|
static int |
SHOWSCREENSIZE
values for tuning the displayModeToLabel method |
static int |
TRUECOLOR
|
| Constructor Summary | |
|---|---|
private |
Screen()
|
| Method Summary | |
|---|---|
private static void |
checkDefaultDevice()
|
static Predicate<DisplayMode> |
displayModeFilter(int minWidth,
int minHeight,
int maxWidth,
int maxHeight,
int minBitDepth,
int maxBitDepth,
int minRefreshRate,
int maxRefreshRate)
yields a Predicate that selects only DisplayModes with the specified bitDepth and refreshRate |
static String |
displayModeToLabel(DisplayMode mode,
int labelMode)
Detemines a String that represents a DisplayMode, in human readable form. |
static String |
displayModeToString(DisplayMode mode)
|
static int |
getBitDepth()
returns the current color bit depth for the default screen device |
static DisplayMode |
getDisplayMode()
returns the current DisplayMode for the default screen device |
static DisplayMode[] |
getDisplayModes()
returns the array of all available DisplayModes for the (default) screen device. |
static String |
getDisplayModeString()
returns a String that describes the current DisplayMode |
static int |
getHeight()
returns the current screen height for the default screen device |
static int |
getRefreshRate()
returns the current refresh rate for the default screen device |
static int |
getWidth()
returns the current screen width for the default screen device |
static void |
printDisplayModes()
prints all available DisplayModes |
static void |
restoreCursor(Component c)
Restores the Cursor that was saved before by setInvisibleCursor(c). |
static DisplayMode |
selectBestDisplayMode(int width,
int height,
int bitDepth,
int refreshRate)
selects an available DisplayMode that matches the specified characteristics as far as possible. |
static ArrayList<DisplayMode> |
selectDisplayModeRange(int minWidth,
int minHeight,
int maxWidth,
int maxHeight,
int minBitDepth,
int maxBitDepth,
int minRefreshRate,
int maxRefreshRate)
returns a List with available DisplayModes, satisfying the specified constraints. |
static ArrayList<DisplayMode> |
selectDisplayModes()
returns a List of DisplayModes that have TRUECOLOR bit depth (32 bit(), and have the same refresh rate as the current refresh rate. |
static ArrayList<DisplayMode> |
selectDisplayModes(int[] preferredScreenSizes)
returns a List of DisplayModes that have TRUECOLOR bit depth (32 bit(), and have the same refresh rate as the current refresh rate. |
static ArrayList<DisplayMode> |
selectDisplayModes(int[] preferredScreenSizes,
int minBitDepth,
int maxBitDepth,
int minRefreshRate,
int maxRefreshRate)
returns a List of DisplayModes that have bit depth and refresh rate within the specified range. |
static ArrayList<DisplayMode> |
selectFilteredDisplayModes(Predicate<DisplayMode> filter)
returns the array of all available DisplayModes that satisfy the specified filter Predicate. |
static void |
setCursor(Component c,
int cursorType)
Sets a cursor for the specified Component. |
static void |
setFullScreen(Frame frame)
tries to set the screen to "fullscreen" mode. |
static void |
setFullScreen(Frame frame,
DisplayMode mode)
tries to set the screen resolution. |
static void |
setFullScreen(Frame frame,
int width,
int height)
tries to set the screen resolution. |
static void |
setFullScreen(Frame frame,
int width,
int height,
int bitDepth)
tries to set the screen resolution. |
static void |
setFullScreen(Frame frame,
int width,
int height,
int bitDepth,
int refreshRate)
tries to set the screen resolution. |
static void |
setInvisibleCursor(Component c)
Sets an "invisble" cursor for the specified Component. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CURRENT_VALUE
public static final int HIGHCOLOR
public static final int TRUECOLOR
public static final int MAX
public static final int MIN
private static final int[] DEFAULTSCREENSIZELIST
public static final int SHOWSCREENSIZE
public static final int SHOWBITDEPTH
public static final int SHOWREFRESHRATE
public static final int SHOWFULLDISPLAYMODE
private static final int EXPECTEDLABELLENGTH
private static final int MAXDIMENSION
private static final int CURSORSIZE
private static GraphicsDevice defaultDevice
private static Cursor noCursor
private static Cursor prevCursor
| Constructor Detail |
|---|
private Screen()
| Method Detail |
|---|
public static DisplayMode[] getDisplayModes()
public static Predicate<DisplayMode> displayModeFilter(int minWidth,
int minHeight,
int maxWidth,
int maxHeight,
int minBitDepth,
int maxBitDepth,
int minRefreshRate,
int maxRefreshRate)
public static ArrayList<DisplayMode> selectFilteredDisplayModes(Predicate<DisplayMode> filter)
public static ArrayList<DisplayMode> selectDisplayModeRange(int minWidth,
int minHeight,
int maxWidth,
int maxHeight,
int minBitDepth,
int maxBitDepth,
int minRefreshRate,
int maxRefreshRate)
public static ArrayList<DisplayMode> selectDisplayModes()
public static ArrayList<DisplayMode> selectDisplayModes(int[] preferredScreenSizes)
public static ArrayList<DisplayMode> selectDisplayModes(int[] preferredScreenSizes,
int minBitDepth,
int maxBitDepth,
int minRefreshRate,
int maxRefreshRate)
public static DisplayMode getDisplayMode()
public static int getRefreshRate()
public static int getBitDepth()
public static int getWidth()
public static int getHeight()
public static String getDisplayModeString()
public static String displayModeToString(DisplayMode mode)
public static String displayModeToLabel(DisplayMode mode,
int labelMode)
public static void printDisplayModes()
public static DisplayMode selectBestDisplayMode(int width,
int height,
int bitDepth,
int refreshRate)
public static void setFullScreen(Frame frame)
public static void setFullScreen(Frame frame,
int width,
int height)
public static void setFullScreen(Frame frame,
int width,
int height,
int bitDepth)
public static void setFullScreen(Frame frame,
int width,
int height,
int bitDepth,
int refreshRate)
public static void setFullScreen(Frame frame,
DisplayMode mode)
public static void setInvisibleCursor(Component c)
public static void setCursor(Component c,
int cursorType)
public static void restoreCursor(Component c)
private static void checkDefaultDevice()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||