- java.lang.Object
-
- java.lang.Enum<Screen.RefreshType>
-
- com.googlecode.lanterna.screen.Screen.RefreshType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Screen.RefreshType>
- Enclosing interface:
- Screen
public static enum Screen.RefreshType extends java.lang.Enum<Screen.RefreshType>
This enum represents the different ways a Screen can refresh the screen, moving the back-buffer data into the front-buffer that is being displayed.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AUTOMATIC
Using automatic mode, the Screen will make a guess at which refresh type would be the fastest and use this one.COMPLETE
InRefreshType.COMPLETE
mode, the screen will send a clear command to the terminal, then redraw the whole back-buffer line by line.DELTA
InRefreshType.DELTA
mode, the Screen will calculate a diff between the back-buffer and the front-buffer, then figure out the set of terminal commands that is required to make the front-buffer exactly like the back-buffer.
-
Constructor Summary
Constructors Modifier Constructor Description private
RefreshType()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Screen.RefreshType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Screen.RefreshType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
AUTOMATIC
public static final Screen.RefreshType AUTOMATIC
Using automatic mode, the Screen will make a guess at which refresh type would be the fastest and use this one.
-
DELTA
public static final Screen.RefreshType DELTA
InRefreshType.DELTA
mode, the Screen will calculate a diff between the back-buffer and the front-buffer, then figure out the set of terminal commands that is required to make the front-buffer exactly like the back-buffer. This normally works well when you have modified only parts of the screen, but if you have modified almost everything it will cause a lot of overhead and you should useRefreshType.COMPLETE
instead.
-
COMPLETE
public static final Screen.RefreshType COMPLETE
InRefreshType.COMPLETE
mode, the screen will send a clear command to the terminal, then redraw the whole back-buffer line by line. This is more expensive thanRefreshType.COMPLETE
, especially when you have only touched smaller parts of the screen, but can be faster if you have modified most of the content, as well as if you suspect the screen's internal front buffer is out-of-sync with what's really showing on the terminal (you didn't go and call methods on the underlying Terminal while in screen mode, did you?)
-
-
Method Detail
-
values
public static Screen.RefreshType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Screen.RefreshType c : Screen.RefreshType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Screen.RefreshType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-