git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
#34 call onResize() when window size is changed
[nikiroo-utils.git]
/
src
/
jexer
/
backend
/
Backend.java
diff --git
a/src/jexer/backend/Backend.java
b/src/jexer/backend/Backend.java
index 664dff954f2ba322c06f3e3928dd32c4605ed07e..20efa7eeaec8ad913387a4a546dcab512f41d512 100644
(file)
--- a/
src/jexer/backend/Backend.java
+++ b/
src/jexer/backend/Backend.java
@@
-31,69
+31,69
@@
package jexer.backend;
import java.util.List;
import jexer.event.TInputEvent;
import java.util.List;
import jexer.event.TInputEvent;
-import jexer.io.Screen;
-import jexer.session.SessionInfo;
/**
/**
- * This
abstract class provides a screen, keyboard, and mouse to
- *
TApplication. It also exposes session information as gleaned from lower
- *
levels of the
communication stack.
+ * This
interface provides a screen, keyboard, and mouse to TApplication. It
+ *
also exposes session information as gleaned from lower levels of the
+ * communication stack.
*/
*/
-public
abstract class
Backend {
+public
interface
Backend {
/**
/**
- * The session information.
- */
- protected SessionInfo sessionInfo;
-
- /**
- * Getter for sessionInfo.
+ * Get a SessionInfo, which exposes text width/height, language,
+ * username, and other information from the communication stack.
*
* @return the SessionInfo
*/
*
* @return the SessionInfo
*/
- public final SessionInfo getSessionInfo() {
- return sessionInfo;
- }
+ public SessionInfo getSessionInfo();
/**
/**
- * The screen to draw on.
+ * Get a Screen, which displays the text cells to the user.
+ *
+ * @return the Screen
*/
*/
- p
rotected Screen screen
;
+ p
ublic Screen getScreen()
;
/**
/**
- * Getter for screen.
- *
- * @return the Screen
+ * Classes must provide an implementation that syncs the logical screen
+ * to the physical device.
*/
*/
- public final Screen getScreen() {
- return screen;
- }
+ public void flushScreen();
/**
/**
- * Subclasses must provide an implementation that syncs the logical
- * screen to the physical device.
+ * Check if there are events in the queue.
+ *
+ * @return if true, getEvents() has something to return to the application
*/
*/
- public
abstract void flushScreen
();
+ public
boolean hasEvents
();
/**
/**
- *
Subc
lasses must provide an implementation to get keyboard, mouse, and
+ *
C
lasses must provide an implementation to get keyboard, mouse, and
* screen resize events.
*
* @param queue list to append new events to
*/
* screen resize events.
*
* @param queue list to append new events to
*/
- public
abstract
void getEvents(List<TInputEvent> queue);
+ public void getEvents(List<TInputEvent> queue);
/**
/**
- *
Subclasses must provide an implementation that closes sockets,
- *
restores
console, etc.
+ *
Classes must provide an implementation that closes sockets, restores
+ * console, etc.
*/
*/
- public
abstract
void shutdown();
+ public void shutdown();
/**
/**
- *
Subc
lasses must provide an implementation that sets the window title.
+ *
C
lasses must provide an implementation that sets the window title.
*
* @param title the new title
*/
*
* @param title the new title
*/
- public abstract void setTitle(final String title);
+ public void setTitle(final String title);
+
+ /**
+ * Set listener to a different Object.
+ *
+ * @param listener the new listening object that run() wakes up on new
+ * input
+ */
+ public void setListener(final Object listener);
}
}