// monospace.
textHeight = fm.getMaxAscent() + maxDescent - leading;
- // TODO: is this still necessary?
if (gotTerminus == true) {
textHeight++;
}
}
}
+ /**
+ * Reset the blink timer.
+ */
+ private void resetBlinkTimer() {
+ // See if it is time to flip the blink time.
+ long nowTime = (new Date()).getTime();
+ lastBlinkTime = nowTime;
+ cursorBlinkVisible = true;
+ }
+
/**
* Paint redraws the whole screen.
*
// Pull the system property for triple buffering.
if (System.getProperty("jexer.Swing.tripleBuffer") != null) {
- if (System.getProperty("jexer.Swing.tripleBuffer").
- equals("false")) {
-
+ if (System.getProperty("jexer.Swing.tripleBuffer").equals("true")) {
+ SwingComponent.tripleBuffer = true;
+ } else {
SwingComponent.tripleBuffer = false;
}
}
SwingTerminal.this.sessionInfo =
new SwingSessionInfo(SwingTerminal.this.swing,
SwingTerminal.this.textWidth,
- SwingTerminal.this.textHeight);
+ SwingTerminal.this.textHeight,
+ windowWidth, windowHeight);
SwingTerminal.this.setDimensions(sessionInfo.getWindowWidth(),
sessionInfo.getWindowHeight());
}
/**
- * Public constructor creates a new JFrame to render to.
+ * Public constructor renders to an existing JComponent.
*
* @param component the Swing component to render to
* @param windowWidth the number of text columns to start with
// Save it and we are done.
synchronized (eventQueue) {
eventQueue.add(new TKeypressEvent(keypress));
+ resetBlinkTimer();
}
- synchronized (listener) {
- listener.notifyAll();
+ if (listener != null) {
+ synchronized (listener) {
+ listener.notifyAll();
+ }
}
}
// Drop a cmAbort and walk away
synchronized (eventQueue) {
eventQueue.add(new TCommandEvent(cmAbort));
+ resetBlinkTimer();
}
- synchronized (listener) {
- listener.notifyAll();
+ if (listener != null) {
+ synchronized (listener) {
+ listener.notifyAll();
+ }
}
}
TResizeEvent windowResize = new TResizeEvent(TResizeEvent.Type.SCREEN,
sessionInfo.getWindowWidth(), sessionInfo.getWindowHeight());
eventQueue.add(windowResize);
+ resetBlinkTimer();
}
- synchronized (listener) {
- listener.notifyAll();
+ if (listener != null) {
+ synchronized (listener) {
+ listener.notifyAll();
+ }
}
}
synchronized (eventQueue) {
eventQueue.add(mouseEvent);
+ resetBlinkTimer();
}
- synchronized (listener) {
- listener.notifyAll();
+ if (listener != null) {
+ synchronized (listener) {
+ listener.notifyAll();
+ }
}
}
synchronized (eventQueue) {
eventQueue.add(mouseEvent);
+ resetBlinkTimer();
}
- synchronized (listener) {
- listener.notifyAll();
+ if (listener != null) {
+ synchronized (listener) {
+ listener.notifyAll();
+ }
}
}
synchronized (eventQueue) {
eventQueue.add(mouseEvent);
+ resetBlinkTimer();
}
- synchronized (listener) {
- listener.notifyAll();
+ if (listener != null) {
+ synchronized (listener) {
+ listener.notifyAll();
+ }
}
}
synchronized (eventQueue) {
eventQueue.add(mouseEvent);
+ resetBlinkTimer();
}
- synchronized (listener) {
- listener.notifyAll();
+ if (listener != null) {
+ synchronized (listener) {
+ listener.notifyAll();
+ }
}
}
synchronized (eventQueue) {
eventQueue.add(mouseEvent);
+ resetBlinkTimer();
}
- synchronized (listener) {
- listener.notifyAll();
+ if (listener != null) {
+ synchronized (listener) {
+ listener.notifyAll();
+ }
}
}